﻿
@model IEnumerable<SILAS.Entidades.Empleado>

@{
    ViewBag.Title = "ListarEmpleados";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css" />
    <script src="http://code.jquery.com/jquery-1.8.2.js"></script>
    <script src="http://code.jquery.com/ui/1.9.0/jquery-ui.js"></script>
<script type="text/javascript">

    $(function () {
        $("#popup").dialog({
            autoOpen: false,
            height: 300,
            width: 350,
            modal: true
        });

        $("#btnNuevo")
            .button()
            .click(function () {
                $("#popup").dialog("open");
            });
    });
</script>


<h2>ListarEmpleados</h2>



<p>
    @Html.ActionLink("Create New", "Create")
</p>

<button id="btnNuevo">Crear Nuevo Empleado</button> 

@using (@Html.BeginForm() )
     {
         <fieldset>
             <legend>Buscar Empleado</legend>
             <b>Apellidos:</b> 
             @Html.TextBox("criterio")
             <input type="submit" value="Buscar" />          
         </fieldset>
     }



<table>
    <tr>

        <th></th>
        <th>
            Nombre
        </th>
        <th>
            ApPaterno
        </th>
        <th>
            ApMaterno
        </th>
        <th>
            DNI
        </th>
        <th>
            Area
        </th>
        <th>
            Email
        </th>
        <th>
            Celular
        </th>
        <th>
            Cargo
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        
            <td>
            @* id=item.PrimaryKey *@
            <center>
            <a href="@Url.Action("Edit", "Empleado", new { id = item.Id })">
               <img src="@Url.Content("~/Content/Imagenes/edit.png")" title="Editar Empleado" alt="Editar Empleado" />
            </a>

             @* @Html.ActionLink("Edit", "Edit", new { id = item.Id }) *@


            </center>
        </td>

        <td>
            @item.Nombre
        </td>
        <td>
            @item.ApPaterno
        </td>
        <td>
            @item.ApMaterno
        </td>
        <td>
            @item.DNI
        </td>
        <td>
            @item.Area
        </td>
        <td>
            @item.Email
        </td>
        <td>
            @item.Celular
        </td>
        <td>
            @item.Cargo.Descripcion
        </td>
    </tr>
}
</table>


<div>
    @Html.ActionLink("Volver a Listar empleados", "ListarEmpleados")
        </div>

<div id="popup">
    @Html.Partial("~/Views/Visita/_DemoCarga.cshtml")
</div>